package com.geccocrawler.gecco.downloader.proxy;

import com.geccocrawler.gecco.spider.Spider;
import com.geccocrawler.gecco.spider.SpiderThreadLocal;

public class ProxysContext {

    public static Proxys get() {
        Spider spider = SpiderThreadLocal.get();
        if (spider == null) {
            return null;
        }
        return spider.getEngine().getProxysLoader();
    }

    public static boolean isEnableProxy() {
        Spider spider = SpiderThreadLocal.get();
        return spider != null && spider.getEngine().isProxy();
    }

}
